//
//  SelectedCell.m
//  videoMove
//
//  Created by gui wei on 11-10-9.
//  Copyright 2011 shanghai enjoymedia. All rights reserved.
//

#import "SelectedCell.h"

@implementation SelectedCell
@synthesize isSelected = _isSelected;

///////////////////////////////////////////////////////////////////////////////////////////////////
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString*)identifier {
	if (self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier]) {
        self.isSelected = NO;
		self.textLabel.backgroundColor = [UIColor clearColor];
		self.contentView.backgroundColor = [UIColor clearColor];
	}
	
	return self;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)setIsSelected:(BOOL)isSelected {
    _isSelected = isSelected;
    
    if(self.backgroundView == nil)
    {
        return;
    }
    
    if(_isSelected)
    {
        self.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"selectedBackground.png"]] autorelease];		
    }
    else
    {
       self.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"unselectedBackground.png"]] autorelease];;		
    }
    [self setNeedsLayout];
	
}

@end
